package test.study.concurrent.thread._6_lock;

import cn.hutool.core.thread.ThreadUtil;
import lombok.extern.slf4j.Slf4j;
import org.openjdk.jol.info.ClassLayout;

/**
 * 默认开启偏向锁
 * -XX:+UseBiasedLocking
 * -XX:BiasedLockingStartupDelay=4000
 */
@Slf4j
public class Lock_01_Main {

    public static void main(String[] args) {
        int sec = 5;
        log.info("sleep {} s", sec);
        ThreadUtil.sleep(sec * 1000);

        Object dog = new Object();
        ClassLayout layout = ClassLayout.parseInstance(dog);
        log.info(layout.toPrintable());
    }
}
